package com.itheima.controller;


import com.qiniu.util.Auth;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UploadController {


	@RequestMapping("/getToken")
	public String getToken(){

		String ak = "QpB4fUbPObhd0b0kI8QYtV9xAMkOaFJVN-Sd_yna";
		String sk = "VUhInOK9SLahdSRbVqpEb851_vJnDeVWHVSszQky";

		Auth auth = Auth.create(ak,sk);

		String token = auth.uploadToken("itcast-health363");

		System.out.println("token=="+token);

		return  token;
	}

	public static void main(String[] args) {
		String ak = "QpB4fUbPObhd0b0kI8QYtV9xAMkOaFJVN-Sd_yna";
		String sk = "VUhInOK9SLahdSRbVqpEb851_vJnDeVWHVSszQky";

		Auth auth = Auth.create(ak,sk);

		String token = auth.uploadToken("itcast-health363");

		System.out.println("token=="+token);
	}

}
